﻿using Albatross.WPF.Common.ViewModels;
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;

namespace Albatross.SharePoint.Explorer.ViewModels {
	public class ListViewModel : ClientObjectViewModel{
		public ListViewModel(ClientContext context, string name, List list) : base(context, name, list) {}

		List List{get{return (List)ClientObject;}}

		public override string GetTreeItemTitle() {
			if (Name == string.Empty) {
				return string.Format("{0} ({1})", List.Title, List.ItemCount);
			} else {
				return Name;
			}
		}

		public override string GetContentTitle() {
			return string.Format("{0} ({1})", List.Title, List.ItemCount);
		}
	}
}
